package com.sg.controller.bff;

import com.sg.service.biz.bff.WeightTargetService;
import com.sg.dto.biz.bff.req.*;
import com.sg.dto.biz.bff.res.*;
import com.sg.common.ro.OkrResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：
 * @version 1.0
 * @date ：
 */
@Api(value = "WeightTarget", tags = {"WeightTarget"})
@RestController
// @RequestMapping("/oms/weightTarget/")
public class WeightTargetController {

    @Autowired
    WeightTargetService weightTargetService;

    /**
     * B3执行一键自动计算平均权重(管理)
     * gen by moon at 10/21/2023, 3:30:40 PM
     */
    @PostMapping("/oms/mgt/weightTarget/implementAutoCountAverageWeight")
    @ApiOperation(value = "B3执行一键自动计算平均权重(管理)", response = OkrResult.class)
    public OkrResult<BffImplementAutoCountAverageWeightRespDto> implementAutoCountAverageWeight(@RequestBody(required = false) @Validated BffImplementAutoCountAverageWeightReqDto reqDTO) {
        return OkrResult.success(weightTargetService.implementAutoCountAverageWeight(reqDTO));
    }

    /**
     * B3查询上级目标周期权重列表(管理)
     * gen by moon at 6/16/2024, 3:16:30 AM
     */
    @PostMapping("/oms/mgt/weightTarget/querySuperiorTargetCycleWeightList")
    @ApiOperation(value = "B3查询上级目标周期权重列表(管理)", response = OkrResult.class)
    public OkrResult<BffQuerySuperiorTargetCycleWeightListRespDto> querySuperiorTargetCycleWeightList(@RequestBody(required = false) @Validated BffQuerySuperiorTargetCycleWeightListReqDto reqDTO) {
        return OkrResult.success(weightTargetService.querySuperiorTargetCycleWeightList(reqDTO));
    }

    /**
     * B3查询下级目标周期权重列表(管理)
     * gen by moon at 6/16/2024, 3:16:38 AM
     */
    @PostMapping("/oms/mgt/weightTarget/querySubordinateTargetCycleWeightList")
    @ApiOperation(value = "B3查询下级目标周期权重列表(管理)", response = OkrResult.class)
    public OkrResult<BffQuerySubordinateTargetCycleWeightListRespDto> querySubordinateTargetCycleWeightList(@RequestBody(required = false) @Validated BffQuerySubordinateTargetCycleWeightListReqDto reqDTO) {
        return OkrResult.success(weightTargetService.querySubordinateTargetCycleWeightList(reqDTO));
    }
}
